package com.example.alarm.bl;

import com.example.alarm.AlarmApplication;
import com.example.alarm.R;
import com.example.alarm.R.raw;

import android.media.MediaPlayer;

public class MediaManager {

	private static MediaManager mInstance;
	private static MediaPlayer mediaPlayer;

	private MediaManager() {
	}

	public static MediaManager getInstance() {
		if (mInstance == null || mediaPlayer == null) {
			mInstance = new MediaManager();
			mediaPlayer = MediaPlayer.create(AlarmApplication.applicationcontext, R.raw.bennyhill);
		}
		return mInstance;
	}

	public void play() {
		if (!mediaPlayer.isPlaying()) {
			mediaPlayer.start();
		}
	}

	public void stop() {
		if (mediaPlayer.isPlaying()) {
			mediaPlayer.pause();
		}
	}

}
